package collection;

import java.util.ArrayList;
import java.util.List;

public class LIstDemo {
    public static void main(String[] args) {
        List<String> c=new ArrayList<>();
        c.add("one");
        c.add("two");
        c.add("three");
        c.add("four");
        c.add("five");
        c.add("one");
        System.out.println(c);

        String s=c.get(3);
        System.out.println(s);
        for (int i=0;i<c.size();i++){
            System.out.println(c.get(i));
        }
        System.out.println("-----------------------------");

        c.set(3,"six");
        System.out.println(c);//[one, two, three, six, five, one]
    }
}
